unit uTweakEditor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ComCtrls, uCore;

type
  TfrmEditor = class(TForm)
    MainPageControl: TPageControl;
    tbsInformation: TTabSheet;
    tbsSoftware: TTabSheet;
    tbsRegistry: TTabSheet;
    btnSave: TBitBtn;
    btnClose: TBitBtn;
    tbsPublisher: TTabSheet;
    lblTitle: TLabel;
    edtTitle: TEdit;
    lblDescription: TLabel;
    memDescription: TMemo;
    lblRoot: TLabel;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    Edit2: TEdit;
    cbbType: TComboBox;
    lblName: TLabel;
    edtName: TEdit;
    lblEmail: TLabel;
    lblWebsite: TLabel;
    edtEmail: TEdit;
    edtCompany: TEdit;
    lblCompany: TLabel;
    edtWebsite: TEdit;
    lblKey: TLabel;
    tbsInput: TTabSheet;
    tbsOptions: TTabSheet;
    lblValue: TLabel;
    lblType: TLabel;
    Label1: TLabel;
    Edit3: TEdit;
    Label2: TLabel;
    Edit4: TEdit;
    Label3: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    procedure WMNCLBUTTONDOWN(var Msg: TWMNCLButtonDown); message WM_NCLBUTTONDOWN;
    procedure WMNCLBUTTONUP(var Msg: TWMNCLButtonUp); message WM_NCLBUTTONUP;
  public
    { Public declarations }
  end;

var
  frmEditor: TfrmEditor;
  twxCore: TTwexCore;

implementation

{$R *.dfm}

procedure TfrmEditor.FormCreate(Sender: TObject);
begin
  twxCore := TTwexCore.Create;
end;

procedure TfrmEditor.FormDestroy(Sender: TObject);
begin
  if (twxCore <> nil) then
    FreeAndNil(twxCore);
end;

procedure TfrmEditor.WMNCLBUTTONDOWN(var Msg: TWMNCLButtonDown);
begin
  if Msg.HitTest = HTHELP then
    Msg.Result := 0
  else
    inherited;
end;

procedure TfrmEditor.WMNCLBUTTONUP(var Msg: TWMNCLButtonUp);
begin
  if Msg.HitTest = HTHELP then
  begin
    Msg.Result := 0;
    twxCore.ShowAboutForm(Self);
  end
  else
    inherited;
end;

end.
